<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="icon" href="./favicon.ico" />
    <?php
    // $site = get_site();
    $site =get_site();
    $p=pg('p')==''?1:pg('p');
    $classify_id=get_classify_id();
    $content_id=pg('content_id');
    $type_id=get_type_id();
    $search=pg('search');
    $member=session('member');
    $member_id=$member['member_id'];
    $member=M('member')->where(array('member_id'=>$member['member_id']))->find();
    $recursive_classify_id=recursive_classify_id($classify_id,3)==''?3:recursive_classify_id($classify_id,3);
    $cart_num=M('cart')->where(array('member_id'=>$member['member_id']))->count();
    if($cart_num=='')$cart_num=0;
    $balance=M('account')->where(array('member_id'=>$member_id))->order('account_id desc')->getfield('balance');
	$today = strtotime(date("Y-m-d"));
	$zoday=$today-(60*60*24);
    $jinri_account=sprintf("%.2f",M('account')->where(array('member_id'=>$member_id,'amount_type'=>2,'date'=>array('GT',$today)))->order('account_id desc')->sum('amount'));
    $zuori_account=sprintf("%.2f",M('account')->where('member_id='.$member_id.' and amount_type=2 and date>'.$zoday.' and date<'.$today)->order('account_id desc')->sum('amount'));
    $zong_account=sprintf("%.2f",M('account')->where('member_id='.$member_id.' and amount_type=2')->order('account_id desc')->sum('amount'));
	//echo M()->_sql();
    if($jinri_account=='')$jinri_account=0.00;
    if($zuori_account=='')$zuori_account=0.00;
    if($zong_account=='')$zong_account=0.00;
    if($balance=='')$balance=0.00;
    $time = time();
    $mobile_url='mobile.php?'.$_SERVER["QUERY_STRING"];
	if(ACTION_NAME!='add' && ACTION_NAME!='edit')session('listurl',$_SERVER['REQUEST_URI']);

	if(session('member')=='')
	{
		goto_url('index.php?m=member&a=index');
	}
    ?>
    <title><?php echo $site['title'];?></title>
    <meta name="keywords" content="<?php echo $site['keywords'];?>" />
    <meta name="description" content="<?php echo $site['description'];?>" />
    <link href="css/chunk-6b66f287.d94b4adf.css"  rel="stylesheet" type="text/css" />
    <link href="css/chunk-vendors.0606ffef.css"  rel="stylesheet" type="text/css" />
    <link href="css/shop.6dd4346e.css"  rel="stylesheet" type="text/css" />
	<link href="css/7977d94de4498228.css"  rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="Index/Tpl/js/common.js"></script>

    <script src="js/laydate/laydate.js" type="text/javascript"></script>
</head>
<body class="">
<style>
a{color: #333333;text-decoration: none;}
</style>
<?php
//session('goodsid',$member);
$goodsid=session('goodsid');
$shu=pg('shu'); ?>